#include <iostream>


#include <list>

using std::cout;
using std::endl;

int main()
{
	{
		std::list<int> l{ 5, 7, 4 };
		l.push_front(8);
		l.push_back(3);

		cout << "list size: " << l.size() << endl;
		for(auto v : l)
		{
			cout << v << " ";
		}
		cout << endl;

		l.resize(9);
		for(auto v : l)
		{
			cout << v << " ";
		}
		cout << endl;

		l.sort();
		cout << "sort: ";
		for(auto v : l)
		{
			cout << v << " ";
		}
		cout << endl;
		l.remove(0);
		l.reverse();
		for(auto v : l)
		{
			cout << v << " ";
		}
		cout << endl;

		std::list<int> l2{ 13, 11, 6 };
		
		l.merge(l2, [](int a, int b) { return b < a; });

		cout << "merge{ 6, 7, 8 }: ";
		for(auto v : l)
		{
			cout << v << " ";
		}
		cout << endl;


	}
	cout << endl;
	return 0;
}
